﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Atom.DataAccess;



namespace Atom.DAL.Common
{
    public abstract class BaseDAL
    {

        private IDataAccess data = null;

        protected IDataAccess DataAccess
        {
            get { return data == null ? DataAccessFactory.instance.CreateDataAccess() : data; }
            set { data = value; }
        }

        public BaseDAL()
        {

            if (DataAccess.IsClosed)
            {
                DataAccess.Open();
            }

        }
        public BaseDAL(IDataAccess data)
        {
            this.data = data;
        }



    }

}
